﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DesignPatternSample.MediatorPattern
{
    public class Mediator
        : AbstractMediator
    {
        public AbstractColleague colleagueA;
        public AbstractColleague colleagueB;
        public override void SendMessage(string message, AbstractColleague colleague)
        {
            if (colleague==colleagueA)
            {
                colleagueB.PrintMessage(message);
            }
            else if (colleague == colleagueB)
            {
                colleagueA.PrintMessage(message);
            }
        }
    }
}
